home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 384 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  961 b 

  1. Path: chewy.vcx.net!usenet
  2. From: Bruce Arnold <barnold@vcx.net>
  3. Newsgroups: comp.lang.c,comp.std.c,comp.lang.c++
  4. Subject: Re: Floating Point arithmetic problem
  5. Date: Thu, 15 Feb 1996 22:39:16 -0800
  6. Organization: Sprint United Telephone/Eastern - Internet @ccess
  7. Message-ID: <31242694.2825@vcx.net>
  8. References: <c968da6jzm.fsf@damayanti.india.ti.com>
  9. NNTP-Posting-Host: y-wing-2a-32.tatooine.vcx.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (Win16; I)
  14.  
  15. > wierd problem with floating point arithmetic on the SUN 4.1.x platform.
  16. > The  insignificant  digits (floating  point) keep accruing ......
  17. > Plan A:  Forget about floating point numbers.  Scale the problem and use integers.
  18. Plan B:  Add a small value, say 0.00000001, so that you never get into the
  19. 9999999999999... problem.  Then use your "scale", "convert to int", "re-scale"
  20. solution to "round off" the unwanted junk.
  21. ...Bruce
  22.